﻿@model IEnumerable<QuestionsAnswers.UI.Models.Question>
@{
    ViewBag.Title = "Index";
}
<h2>
    Index</h2>
<p>
    @Html.ActionLink("Create New", "Create")
</p>
<table>
    <tr>
        <th>
            Text
        </th>
        <th>
            User
        </th>
        <th>
        </th>
    </tr>
    @foreach (var item in Model)
    {
        <tr>
            <td>
                @Html.DisplayFor(modelItem => item.Text)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.User.UserName)
            </td>
         
            <td>
                @Html.ActionLink("Edit", "Edit", new { id = item.QuestionId }) |
                @Html.ActionLink("Answers", "Index","Answer", new { id = item.QuestionId },"") |
                @Html.ActionLink("Delete", "Delete", new { id = item.QuestionId })
            </td>
        </tr>
    }
</table>
